home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programmer Power Tools
/
Programmer Power Tools.iso
/
cmplngmg
/
cl_jun89.arc
/
AWK210.ARC
/
FMT.AWK
< prev
next >
Wrap
Text File
|
1988-03-01
|
426b
|
21 lines
# fmt - format
# input: text
# output: text formatted into lines of <= 60 characters
/./ { for (i = 1; i <= NF; i++) addword($i) }
/^$/ { printline(); print "" }
END { printline() }
function addword(w) {
if (length(line) + length(w) > 60)
printline()
line = line " " w
}
function printline() {
if (length(line) > 0) {
print substr(line, 2)
line = ""
}
}